[2025-09-06] WebHacking.kr 1์ผ์ฐจ
๐ฆฅ ๋ณธ๋ฌธ
Challenge 1
<?php
include "../../config.php";
if($_GET['view-source'] == 1){ view_source(); }
if(!$_COOKIE['user_lv']){
SetCookie("user_lv","1",time()+86400*30,"/challenge/web-01/");
echo("<meta http-equiv=refresh content=0>");
}
?>
<html>
<head>
<title>Challenge 1</title>
</head>
<body bgcolor=black>
<center>
<br><br><br><br><br>
<font color=white>
---------------------<br>
<?php
if(!is_numeric($_COOKIE['user_lv'])) $_COOKIE['user_lv']=1;
if($_COOKIE['user_lv']>=4) $_COOKIE['user_lv']=1;
if($_COOKIE['user_lv']>3) solve(1);
echo "<br>level : {$_COOKIE['user_lv']}";
?>
<br>
<a href=./?view-source=1>view-source</a>
</body>
</html>
SetCookie() : user_lv ๊ฐ์ 1 ๋ก ์ง์ . ๋ง๋ฃ ๊ธฐ๊ฐ์ ํ๋ฌ. /challenge/web-01 ๊ฒฝ๋ก๋ก ์จ ๊ฒ๋ง ์
ํ
ํ์ด ๊ณผ์
user_lv ์ ๊ฐ์ด 3๋ณด๋ค ํฌ๊ณ 4๋ณด๋ค ์์ผ๋ฉด solve. ์ฟ ํค์์ ํด๋น ๊ฐ์ 3.5๋ก ์ง์ .
Challenge 15

alert() ์ดํ์๋ webhacking.kr๋ก ๋ฆฌ๋๋ ์
๋๋ค. ์ฝ๋๋ฅผ ๋ณด๊ธฐ ์ํด์๋ ํด๋น ์๋ฐ์คํฌ๋ฆฝํธ๋ฅผ ์คํ ๋ชปํ๊ฒ ๋ง์์ผ ํ๋ค.
ํ์ด ๊ณผ์
ํฌ๋กฌ์์ ์ค์ > ๊ฐ์ธ ์ ๋ณด ๋ณดํธ > ์๋ฐ์คํฌ๋ฆฝํธ ํญ์์ ํด๋น ์ฌ์ดํธ์ ์๋ฐ์คํฌ๋ฆฝํธ ๊ถํ์ ํด์ ํ๋ฉด ๋น ํ์ด์ง์ ๋ค์๊ณผ ๊ฐ์ ์ฝ๋๊ฐ ๋์จ๋ค
<script>
alert("Access_Denied");
location.href='/';
document.write("<a href=?getFlag>[Get Flag]</a>");
</script>
ํ๋ผ๋ฏธํฐ๋ก getFlag๋ฅผ ๋ฃ์ด์ฃผ๋ฉด ํด๊ฒฐ๋๋ค.
Challenge 26
<?php
include "../../config.php";
if($_GET['view_source']) view_source();
?><html>
<head>
<title>Challenge 26</title>
<style type="text/css">
body { background:black; color:white; font-size:10pt; }
a { color:lightgreen; }
</style>
</head>
<body>
<?php
if(preg_match("/admin/",$_GET['id'])) { echo"no!"; exit(); }
$_GET['id'] = urldecode($_GET['id']);
if($_GET['id'] == "admin"){
solve(26);
}
?>
<br><br>
<a href=?view_source=1>view-source</a>
</body>
</html>
ํด๋น ์ฝ๋์์ id ๊ฐ์ admin์ ์ ๋ ฅํ๋ฉด ์ฑ๊ณต์ด์ง๋ง ํํฐ๋ง์ด ์๋ค.
ํ์ด ๊ณผ์
ํด๋น ์ฝ๋์์ ๋์ฝ๋ฉ์ ํ ๋ฒ ๋ ํ๊ธฐ ๋๋ฌธ์, admin์ ํ ๋ฒ ๋ ์ธ์ฝ๋ฉ์ ํ์ฌ URL์ ๋ณด๋ด ์ฃผ๋ฉด ๋๋ค.
id=%2561%2564%256D%2569%256E
Challenge 16
<html>
<head>
<title>Challenge 16</title>
<body bgcolor=black onload=kk(1,1) onkeypress=mv(event.keyCode)>
<font color=silver id=c></font>
<font color=yellow size=100 style=position:relative id=star>*</font>
<script>
document.body.innerHTML+="<font color=yellow id=aa style=position:relative;left:0;top:0>*</font>";
function mv(cd){
kk(star.style.left-50,star.style.top-50);
if(cd==100) star.style.left=parseInt(star.style.left+0,10)+50+"px";
if(cd==97) star.style.left=parseInt(star.style.left+0,10)-50+"px";
if(cd==119) star.style.top=parseInt(star.style.top+0,10)-50+"px";
if(cd==115) star.style.top=parseInt(star.style.top+0,10)+50+"px";
if(cd==124) location.href=String.fromCharCode(cd)+".php"; // do it!
}
function kk(x,y){
rndc=Math.floor(Math.random()*9000000);
document.body.innerHTML+="<font color=#"+rndc+" id=aa style=position:relative;left:"+x+";top:"+y+" onmouseover=this.innerHTML=''>*</font>";
}
</script>
</body>
</html>
ํด๋น ์ฝ๋๋ evnet.keyCode์ ๊ฐ์ ๋ฐ๋ผ ๋ณํ๋ ํ์ด์ง๋ฅผ ๋ณผ ์ ์๋ค
ํ์ด๊ณผ์
124์ ํด๋นํ๋ ๋ฌธ์์ด์ | ์ด๊ณ |.php ๋ฅผ ์ ์ํ๋ฉด ํด๊ฒฐ๋๋ค.
Leave a comment